-- card: 32219 from stack: in.5 -- bmap block id: 41936 -- flags: 0000 -- background id: 3858 -- name: DocumentCreator ----- HyperTalk script ----- on OpenCard put thisVolumePath() into cd fld "volume" pass OpenCard end OpenCard on CloseCard put empty into cd fld "volume" pass CloseCard end CloseCard on hideObjects hide cd btn "Try It!" hide cd btn "choose" hide cd btn "creator popup" hide cd fld "volume" hide cd fld "creator" hide cd fld "label" hide cd fld "label 2" end hideObjects on showObjects show cd btn "Try It!" show cd btn "choose" show cd btn "creator popup" show cd fld "volume" show cd fld "creator" show cd fld "label" show cd fld "label 2" end showObjects -- part 1 (button) -- low flags: 00 -- high flags: 0000 -- rect: left=207 top=159 right=181 bottom=236 -- title width / last selected line: 0 -- icon id / first selected line: 12030 / 12030 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: creator popup ----- HyperTalk script ----- on mousedown put item 3 of rect of the target - 5 into horiz put 20 into vert put "MSWD;MACA;nX^n;" & "-\d;EDIT;QED1;McSk;" & "-\d;GEOL;zTRM;DFB0;NavC;" & "-\d;WILD;RUNT;" & "-\d;PJMM;MPS ;" & "-\d;XCEL" into menuTxt get wavesHPopUp(-1,0,menuTxt, vert, horiz) if line 1 of it is not empty then put char 1 to 4 of line 1 of it into cd fld "Creator" set the hilite of me to false end if end mousedown -- part 2 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=123 top=159 right=179 bottom=199 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: Creator -- part 4 (field) -- low flags: 00 -- high flags: 0002 -- rect: left=80 top=192 right=212 bottom=199 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 0 -- font id: 3 -- text size: 12 -- style flags: 256 -- line height: 16 -- part name: volume -- part 5 (button) -- low flags: 00 -- high flags: A004 -- rect: left=205 top=192 right=211 bottom=252 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 3 -- text size: 12 -- style flags: 0 -- line height: 16 -- part name: Choose ----- HyperTalk script ----- on mouseUp put volumePath() into newVolume if newVolume ≠ empty then put newVolume into cd fld "volume" end mouseUp -- part 6 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=63 top=163 right=180 bottom=114 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: label -- part 7 (field) -- low flags: 01 -- high flags: 0000 -- rect: left=25 top=195 right=212 bottom=76 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 65535 -- font id: 3 -- text size: 10 -- style flags: 0 -- line height: 13 -- part name: label 2 -- part 8 (button) -- low flags: 00 -- high flags: A002 -- rect: left=108 top=240 right=274 bottom=201 -- title width / last selected line: 0 -- icon id / first selected line: 0 / 0 -- text alignment: 1 -- font id: 0 -- text size: 12 -- style flags: 8192 -- line height: 16 -- part name: Try it! ----- HyperTalk script ----- on mouseUp global errGlobal put DocumentCreator(cd fld "volume", cd fld "creator", "noDialog:errGlobal") into parentApp if errGlobal = empty then put "Files of type “" & cd fld "creator" & "” are created by" && parentApp else answer "Error: “" & errGlobal & "”" hide msg put empty into errGlobal end if end mouseUp -- part contents for background part 20 ----- text ----- This XFCN takes a four character creator signature and looks through the desktop file on the specified volume for the name of the application which created it. If no matches are found in the specified volume it looks throught the desktop file on each mounted volume. To use this demo fill in both fields on the left, and click on the "Try It!" button. Calling syntax : DocumentCreator(volName, creatorString, <"noDialog:"errorGlobal>) VOLNAME: the path to the volume to search CREATORSTRING: a four character file creator signature Portions of this code are taken from Dan Winkler's "getCreator" XFCN. -- part contents for card part 2 ----- text ----- WILD -- part contents for card part 6 ----- text ----- creator -- part contents for card part 7 ----- text ----- volume -- part contents for background part 38 ----- text ----- 11/50